Probabilistic Analysis of the Dual-Pivot Quicksort "Count"
نویسندگان
چکیده
Recently, Aumüller and Dietzfelbinger proposed a version of a dual-pivot quicksort, called “Count”, which is optimal among dual-pivot versions with respect to the average number of key comparisons required. In this note we provide further probabilistic analysis of “Count”. We derive an exact formula for the average number of swaps needed by “Count” as well as an asymptotic formula for the variance of the number of swaps and a limit law. Also for the number of key comparisons the asymptotic variance and a limit law are identified. We also consider both complexity measures jointly and find their asymptotic correlation.
منابع مشابه
Why Is Dual-Pivot Quicksort Fast?
I discuss the new dual-pivot Quicksort that is nowadays used to sort arrays of primitive types in Java. I sketch theoretical analyses of this algorithm that offer a possible, and in my opinion plausible, explanation why (a) dual-pivot Quicksort is faster than the previously used (classic) Quicksort and (b) why this improvement was not already found much earlier.
متن کاملPivot Sampling in Dual-Pivot Quicksort
The new dual-pivot Quicksort by Vladimir Yaroslavskiy — used in Oracle’s Java runtime library since version 7 — features intriguing asymmetries in its behavior. They were shown to cause a basic variant of this algorithm to use less comparisons than classic single-pivot Quicksort implementations. In this paper, we extend the analysis to the case where the two pivots are chosen as fixed order sta...
متن کاملPivot Sampling in Java 7's Dual-Pivot Quicksort
The new dual-pivot Quicksort by Vladimir Yaroslavskiy — used in Oracle’s Java runtime library since version 7 — features intriguing asymmetries in its behavior. They were shown to cause a basic variant of this algorithm to use less comparisons than classic single-pivot Quicksort implementations. In this paper, we extend the analysis to the case where the two pivots are chosen as fixed order sta...
متن کاملDual pivot Quicksort
In this paper, we analyse the dual pivot Quicksort, a variant of the standard Quicksort algorithm, in which two pivots are used for the partitioning of the array. We are solving recurrences of the expected number of key comparisons and exchanges performed by the algorithm, obtaining the exact and asymptotic total average values contributing to its time complexity. Further, we compute the averag...
متن کاملAverage Case and Distributional Analysis of Java 7's Dual Pivot Quicksort
In 2009, Oracle replaced the long-serving sorting algorithm in its Java 7 runtime library by a new dual pivot Quicksort variant due to Yaroslavskiy. The decision was based on the strikingly good performance of Yaroslavskiy’s implementation in running time experiments. At that time, no precise investigations of the algorithm were available to explain its superior performance — on the contrary: P...
متن کامل